package org.jackysoft.struts2.admin;
import java.util.Collection;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Namespace;
import org.jackysoft.entity.UserSetting;
import org.jackysoft.service.UserSettingService;
import org.jackysoft.struts2.UtilsCRUDAction;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;


@Controller
@Namespace("/usersetting")
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class UserSettingAction 
extends UtilsCRUDAction<UserSetting> {
	/**
	 * 
	 */
	private static final long serialVersionUID = -1168503894941721686L;
	private UserSettingService service;
	private UserSetting bean;
	private Collection<UserSetting> beans;
	
	
	public String myus()throws Exception{
		bean = service.getByOwner(bean.getOwner());
		return BEANDATA;
	}
	
	public void setBean(UserSetting bean){
	     this.bean = bean;
	}
	public UserSetting getBean(){
	     return this.bean;
	}
	public void setBeans(Collection<UserSetting> beans){
	
	     this.beans = beans;
	}
	public Collection<UserSetting> getBeans(){
	     return this.beans;
	}
	
	@Resource
	public void setService(UserSettingService service) {
		this.service = service;
		this.setDataProvider(service);
	}	
	
	public UserSettingService getService(){
	   return this.service;
	}
		
}